package com.zj.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class AroundAdvice implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {

        String name = invocation.getMethod().getName();
        System.out.println(name + "环绕前通知。");
        Object proceed = invocation.proceed();
        System.out.println(name + "环绕后通知，结果：" + proceed);

        return proceed;
    }
}
